import httpRequest from '@/utils/httpRequest'
// 获取业务类型模型字典数据
export function getDictModelList (data) {
  return httpRequest({
    url: '/model/getDictModelList',
    method: 'get',
    params: data
  })
}
// 左侧模块列表
export function getModel (data) {
  return httpRequest({
    url: '/modular/modularList',
    method: 'get',
    params: data
  })
}
// 全局变量管理：左侧变量分组列表
export function groupList (data) {
    return httpRequest({
        url: '/var/groupList',
        method: 'get',
        params: data
    })
}
// 获取指定模块下模型列表
export function getModelList (data) {
  return httpRequest({
    url: '/model/getModelList',
    method: 'get',
    params: data
  })
}

// 获取指定模块下全局变量列表
export function getVarlList (data) {
  return httpRequest({
    url: '/var/sgroup',
    method: 'get',
    params: data
  })
}
// 全局变量获取指定模块下全局变量列表
export function getGlobalVarlList (data) {
  return httpRequest({
    url: '/var/globalSgroup',
    method: 'get',
    params: data
  })
}

// 修改变量值
export function updateVarValue (data) {
  return httpRequest({
    url: '/var/updateVarValue',
    method: 'post',
    data: data,
    headers: {'Content-Type': 'application/json; charset=utf-8'}
  })
}

// 修改变量值
export function updateModelBusinessValue (data) {
  return httpRequest({
    url: '/model/updateValue',
    method: 'post',
    data: data,
    headers: {'Content-Type': 'application/json; charset=utf-8'}
  })
}

// 修改模型状态
export function updateState (data) {
  return httpRequest({
    url: '/model/updateState',
    method: 'post',
    data: data,
    headers: {'Content-Type': 'application/json; charset=utf-8'}
  })
}
// 删除模型
export function modelDelete (data) {
  return httpRequest({
    url: '/model/delete',
    method: 'post',
    data: data,
    headers: {'Content-Type': 'application/json; charset=utf-8'}
  })
}
// 修改模型
export function saveModel (data) {
  return httpRequest({
    url: '/model/save',
    method: 'post',
    data: data,
    headers: {'Content-Type': 'application/json; charset=utf-8'}
  })
}
// 获取模型模板
export function getModelPage (data) {
  return httpRequest({
    url: '/model/getModelPage',
    method: 'get',
    params: data
  })
}
// 获取模型模板数据回显
export function getModelPageByBusinessId (data) {
  return httpRequest({
    url: '/business/getModelPageByBusinessId',
    method: 'get',
    params: data
  })
}
// 获取模型模板数据回显
export function confirmBusiness (data) {
  return httpRequest({
    url: '/business/confirmBusiness',
    method: 'get',
    params: data
  })
}

// 获取模型变量busControl
export function getBusControlVar (data) {
  return httpRequest({
    url: '/model/getBusControlVar',
    method: 'get',
    params: data
  })
}
// 提交form表单
export function postModelPage (data) {
  return httpRequest({
    url: '/business/save',
    method: 'post',
    headers: {'Content-Type': 'application/json; charset=utf-8'},
    data: data
  })
}
// 移除上传文件
export function deleteFile (data) {
  return httpRequest({
    url: '/business/deleteFile',
    method: 'post',
    data: data
  })
}

// 获取模块下拉列表
export function getAllSelectModular (data) {
  return httpRequest({
    url: '/modular/getAllSelectModular',
    method: 'get',
    params: data
  })
}

// 根据模块id获取业务类型下拉框
export function getTypeByModularId (data) {
  return httpRequest({
    url: '/modular/getTypeByModularId',
    method: 'get',
    params: data
  })
}

// 根据模块id获取业务类型下拉框
export function getModelInfo (data) {
  return httpRequest({
    url: '/model/getInfo',
    method: 'get',
    params: data
  })
}
